package sigletondemo;
//使用单例模式之懒汉式实例化一个校长；
public class Principal {
    private static Principal principal;
    private String name;

    public Principal() {
        this.name = "王校长";
    }
    public static Principal getPrincipal(){
        if(principal==null){
            principal=new Principal();
        }
        return principal;
    }
    public void announcement(String message){
        System.out.println(name+"通知"+message);
    }
    public void approveDocument(String file){
        System.out.println(name+"审批通过"+file);
    }
}
